﻿angular.module('resources.disputeTrackingProxy', []);
angular.module('resources.disputeTrackingProxy').factory('disputeTrackingProxy', ['rresource', '$http', 'APPSETTING', function (rresource, $http, APPSETTING) {
    var factory = rresource('disputeTracking');
    factory.sendEmailUrl = 'api/disputeTracking/sendMail';
    
    factory.disputeTrackingPaging = function (index, itemCount, filter, successcb, failedcb) {

        var itemspage = (index - 1) * itemCount;
        var filterStr = "$top=" + itemCount + "&$skip=" + itemspage + "&$orderby= Status, CreateDate " + filter + "&$count=true";
        return factory.odataQuery(filterStr, successcb, failedcb);

    };

    //save Special Notes
    factory.savenotes = function (list, successcb, failedcb) {
        $http({
            url: APPSETTING['serverUrl'] + '/api/disputeTracking',
            method: 'POST',
            data: list
        }).success(function (response) {
            successcb(response);
        }).error(function (ex) {
            failedcb(ex);
        });
    };

    return factory;
} ]);
